package com.chuyu.jzwboa.presenter.launcher;

import android.content.Context;

import com.chuyu.jzwboa.model.imodel.launcher.ILauncherModel;
import com.chuyu.jzwboa.model.models.launcher.LauncherModel;
import com.chuyu.jzwboa.view.iview.launcher.ILauncherView;
import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;

/**
 * @author 杨仕俊
 * @description  启动界面的presnter
 * Created by wo on 2017/12/14.
 */

public class LauncherPersenter extends MvpBasePresenter<ILauncherView>{
    /**
     * 获取权限
     * @param context
     * @param permissions
     */
    public void getPermission(Context context, String... permissions){
        if (isViewAttached()){

        }else {
            return;
        }
        final ILauncherView view = getView();
        //model  中获取权限
        LauncherModel.getInstance().detectionPermissions(context, new ILauncherModel.IPermissionLisenter() {
            @Override
            public void hasPersmission() {
                view.changeActivity(true);
            }

            @Override
            public void notPermission() {
                view.changeActivity(false);
            }
        } ,permissions);

    }
}
